home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Linux
/
Kubuntu 8.10
/
kubuntu-8.10-desktop-i386.iso
/
casper
/
filesystem.squashfs
/
usr
/
sbin
/
update-usbids
< prev
next >
Wrap
Text File
|
2008-09-23
|
644b
|
39 lines
#!/bin/sh
# see also update-pciids.sh (fancier)
set -e
SRC="http://linux-usb.sourceforge.net/usb.ids"
DEST=/var/lib/misc/usb.ids
umask 022
if which wget >/dev/null ; then
DL="wget -O $DEST.new $SRC"
elif which lynx >/dev/null ; then
DL="eval lynx -source $SRC >$DEST.new"
else
echo >&2 "update-usbids: cannot find wget nor lynx"
exit 1
fi
if ! $DL ; then
echo >&2 "update-usbids: download failed"
rm -f $DEST.new
exit 1
fi
if ! grep >/dev/null "^C " $DEST.new ; then
echo >&2 "update-usbids: missing class info, probably truncated file"
exit 1
fi
if [ -f $DEST ] ; then
mv $DEST $DEST.old
fi
mv $DEST.new $DEST
echo "Done."